package com.sam.im.heiqun.uis.activities;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.bumptech.glide.Glide;
import com.sam.im.heiqun.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import com.sam.im.heiqun.utils.StringUtils;

public class ReadDeleteActivity extends AppCompatActivity {

    @BindView(R.id.img)
    ImageView imgs;
    @BindView(R.id.backgroud)
    RelativeLayout backgroud;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_read_delete);
        ButterKnife.bind(this);
        String img = getIntent().getStringExtra("img");
        if (img != null&& !StringUtils.isEmpty(img)) {
            Glide.with(this).load(img).centerCrop().into(imgs);
        }
        backgroud.setPressed(true);
        backgroud.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent motionEvent) {
                switch(motionEvent.getAction()){
                    case MotionEvent.ACTION_DOWN:
                        Log.i("info","按下");
                        //
                        break;
                    case MotionEvent.ACTION_UP:
                        Log.i("info","抬起");
                        finish();
                        //
                        break;
                    case MotionEvent.AXIS_PRESSURE:
                        Log.i("info","按下");
                        break;


                }
                return true;
            }
        });
    }
}
